<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>flex</title>
  <style>
    .container {
      display: flex;
      border: 1px solid #788cff;
    }

    .container > div {
      background: linear-gradient(-45deg, #788cff, #b4c8ff);
    }

    #justify-content-wrapper > div {
      width: 100px;
      height: 100px;
    }

    #align-items-wrapper {
      width: 400px;
      height: 200px;
      justify-content: space-between;
    }

    #align-items-wrapper > div {
      width: 100px;
    }

    #align-content-wrapper {
      width: 500px;
      height: 400px;
      flex-wrap: wrap;
    }

    #align-content-wrapper > div {
      margin: 4px;
    }

    #align-content-wrapper > div:nth-child(odd) {
      width: 80px;
    }

    #align-content-wrapper > div:nth-child(odd) {
      width: 100px;
    }
  </style>
</head>

<body>
  <section>
    <h2>justify-content</h2>
      <div class="container" id="justify-content-wrapper">
        <div>text</div>
        <div style="line-height: 18px;">text</div>
        <div style="line-height: 32px;">text</div>
      </div>
      <div>
        <select name="" id="justify-content-select">
          <option value="center">center</option>
          <option value="start">start</option>
          <option value="end">end</option>
          <option value="flex-start">flex-start</option>
          <option value="flex-end">flex-end</option>
          <option value="left">left</option>
          <option value="right">right</option>
          <option value="baseline">baseline</option>
          <option value="first baseline">first baseline</option>
          <option value="last baseline">last baseline</option>
          <option value="space-between">space-between</option>
          <option value="space-around">space-around</option>
          <option value="space-evenly">space-evenly</option>
          <option value="stretch">stretch</option>
          <option value="safe center">safe center</option>
          <option value="unsafe center">unsafe center</option>
        </select>
    </div>
  </section>

  <section>
    <h2>align-items</h2>
      <div class="container" id="align-items-wrapper">
        <div>text</div>
        <div style="height: 150px; line-height: 18px;">text</div>
        <div style="height: 200px; line-height: 32px;">text</div>
      </div>
      <div>
        <select name="" id="align-items-select">
          <option value="normal">normal</option>
          <option value="stretch">stretch</option>
          <option value="center">center</option>
          <option value="start">start</option>
          <option value="end">end</option>
          <option value="flex-start">flex-start</option>
          <option value="flex-end">flex-end</option>
          <option value="self-start">self-start</option>
          <option value="self-end">self-end</option>
          <option value="baseline">baseline</option>
          <option value="first baseline">first baseline</option>
          <option value="last baseline">last baseline</option>
          <option value="safe center">safe center</option>
          <option value="unsafe center">unsafe center</option>
        </select>
    </div>
  </section>

  <section>
    <h2>align-content</h2>
      <div class="container" id="align-content-wrapper">
        <div>text</div>
        <div style="height: 150px; line-height: 18px;">text</div>
        <div style="height: 200px; line-height: 32px;">text</div>
        <div>text</div>
        <div>text</div>
        <div>text</div>
        <div>text</div>
        <div>text</div>
        <div>text</div>
      </div>
      <div>
        <select name="" id="align-content-select">
          <option value="normal">normal</option>
          <option value="center">center</option>
          <option value="start">start</option>
          <option value="end">end</option>
          <option value="flex-start">flex-start</option>
          <option value="flex-end">flex-end</option>
          <option value="space-between">space-between</option>
          <option value="space-around">space-around</option>
          <option value="space-evenly">space-evenly</option>
          <option value="stretch">stretch</option>
          <option value="baseline">baseline</option>
          <option value="first baseline">first baseline</option>
          <option value="last baseline">last baseline</option>
          <option value="safe center">safe center</option>
          <option value="unsafe center">unsafe center</option>
        </select>
    </div>
  </section>

  <script>
    const justifyContentSelect = document.getElementById('justify-content-select')
    const justifyContentWrapper = document.getElementById('justify-content-wrapper')
    justifyContentSelect.addEventListener('change', () => {
      console.log(justifyContentSelect.value)
      justifyContentWrapper.style.justifyContent = justifyContentSelect.value
    })

    const alignItemsSelect = document.getElementById('align-items-select')
    const alignItemsWrapper = document.getElementById('align-items-wrapper')
    alignItemsSelect.addEventListener('change', () => {
      console.log(alignItemsSelect.value)
      alignItemsWrapper.style.alignItems = alignItemsSelect.value
    })

    const alignContentSelect = document.getElementById('align-content-select')
    const alignContentWrapper = document.getElementById('align-content-wrapper')
    alignContentSelect.addEventListener('change', () => {
      console.log(alignContentSelect.value)
      alignContentWrapper.style.alignContent = alignContentSelect.value
    })
  </script>
</body>

</html>